

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0"> 
	<title>注册界面</title>
    <link href="/static/login/css/default.css" rel="stylesheet" type="text/css" />
	<!--必要样式-->
    <link href="/static/login/css/styles.css" rel="stylesheet" type="text/css" />
    <link href="/static/login/css/demo.css" rel="stylesheet" type="text/css" />
    <link href="/static/login/css/loaders.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class='login'>
	  <div class='login_title'>
	    <span>管理员注册</span>
	  </div>
	  <div class='login_fields'>
	    <div class='login_fields__user'>
	      <div class='icon'>
	        <img alt="" src='/static/login/img/user_icon_copy.png'>
	      </div>
	      <input name="login" placeholder='用户名' maxlength="16" type='text' autocomplete="off" value="123456" class='user'>
	        <div class='validation'>
	          <img alt="" src='/static/login/img/tick.png'>
	        </div>
	    </div>
	    <div class='login_fields__password'>
	    <div class='icon'>
	       <img alt="" src='/static/login/img/lock_icon_copy.png'>
	    </div>
	      <input name="pwd" placeholder='密码' maxlength="16" type='text' autocomplete="off" class='pwd'>
	    <div class='validation' >
	        <img alt="" src='/static/login/img/tick.png'>
	    </div>
	    </div>
	    <div class='login_fields__password'>
	    <div class='icon'>
	       <img alt="" src='/static/login/img/key.png'>
	    </div>
	      <input name="code" placeholder='验证码' maxlength="4" type='text' name="ValidateNum" autocomplete="off" class='code'>
	    <div class='validation' style="opacity: 1; right: -5px;top: -3px;">
	      <canvas class="J_codeimg" id="myCanvas" onclick="Code();">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>
	    </div>
	    </div> 

	    <div class='login_fields__password'>
	    <div class='icon'>
	       <img alt="" src='/static/login/img/key.png'>
	    </div>
	      <input name="cd" placeholder='手机验证码' maxlength="4" type='text' name="ValidateNum" autocomplete="off" style="width: 200px;cursor:pointer">
	    <div class='validation sendCode' style="opacity: 1; right: 15px;top: -3px; line-height:45px; cursor:pointer" >
	    	点击发送验证码
	    </div>
	    </div>
	    <div class='login_fields__password'>
	    <div class='icon'>
	       <img alt="" src='/static/login/img/key.png'>
	    </div>
	      <input name="cd" placeholder='邮箱验证码' maxlength="4" type='text' name="ValidateNum" autocomplete="off" style="width: 200px;cursor:pointer">
	    <div class='validation sendE' style="opacity: 1; right: 15px;top: -3px; line-height:45px; cursor:pointer" >
	    	点击发送验证码
	    </div>
	    </div>
	    <div class='login_fields__submit'>
	      <input type='button' value='注册' id='zc' >
	    </div>
	  </div>


	  <div class='success'>
	  </div>
	  <div class='disclaimer'>
	  </div>
	</div>
	<div class='authent'>
	  <div class="loader" style="height: 44px;width: 44px;margin-left: 28px;">
        <div class="loader-inner ball-clip-rotate-multiple">
            <div></div>
            <div></div>
            <div></div>
        </div>
        </div>
	  <p>认证中...</p>
	</div>
	<div class="OverWindows"></div>
	
    <link href="/static/login/layui/css/layui.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript" src="/static/login/js/jquery.min.js"></script>
	<script type="text/javascript" src="/static/login/js/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="/static/login/js/jquery-ui.min.js"></script>
	<script type="text/javascript" src='/static/login/js/stopExecutionOnTimeout.js?t=1'></script>
    <script type="text/javascript" src="/static/login/layui/layui.js"></script>
    <script type="text/javascript" src="/static/login/js/Particleground.js"></script>
    <script type="text/javascript" src="/static/login/Js/Treatment.js"></script>
    <script type="text/javascript" src="/static/login/js/jquery.mockjax.js"></script>
	<script type="text/javascript">
	var canGetCookie = 0;//是否支持存储Cookie 0 不支持 1 支持
	var ajaxmockjax = 1;//是否启用虚拟Ajax的请求响 0 不启用  1 启用
	$(function(){
	     // 正常提交注册
		var CodeVal = 0;
	    Code();
	    function Code() {
			if(canGetCookie == 1){
				createCode("AdminCode");
				var AdminCode = getCookieValue("AdminCode");
				showCheck(AdminCode);
			}else{
				showCheck(createCode(""));
			}
	    }
	    function showCheck(a) {
			CodeVal = a;
	        var c = document.getElementById("myCanvas");
	        var ctx = c.getContext("2d");
	        ctx.clearRect(0, 0, 1000, 1000);
	        ctx.font = "80px 'Hiragino Sans GB'";
	        ctx.fillStyle = "#E8DFE8";
	        ctx.fillText(a, 0, 100);
	    }
	    $(document).keypress(function (e) {
	        // 回车键事件  
	        if (e.which == 13) {
	            $('input[type="button"]').click();
	        }
	    });
	    //粒子背景特效
	    $('body').particleground({
	        dotColor: '#E8DFE8',
	        lineColor: '#133b88'
	    });

	    var open = 0;
    	layui.use('layer', function () {
		var msgalert = '欢迎注册';
		var index = layer.alert(msgalert, { icon: 6, time: 4000, offset: 't', closeBtn: 0, title: '友情提示', btn: [], anim: 2, shade: 0 });  
		layer.style(index, {
			color: '#777'
		}); 
        //非空验证
        $(document).on('click','.dologin',function () {
            var user = $('.user').val();
            var pwd = $('.pwd').val();
            var code = $('.code').val();
            if (user == '') {
                ErroAlert('请输入您的账号11');
            } else if (pwd == '') {
                ErroAlert('请输入密码');
            } else if (code == '' || code.length != 4) {
                ErroAlert('请输入验证码');
            } else if(code != CodeVal){
                ErroAlert('请输入正确的验证码');

            } else {

            var data = 'user='+user+'&pwd='+pwd;
		        $.ajax({
		            type : 'get',
		            url : 'Login/username',
		            data : data,
		            dataType : 'json',
		            success : function (data) {
		            	ErroAlert(data);
		            },
		            error : function () {
		                console.log(data);
		                alert('访问出错');
		            }
		    	});
           	}
        })
    })
	    var fullscreen = function () {
	        elem = document.body;
	        if (elem.webkitRequestFullScreen) {
	            elem.webkitRequestFullScreen();
	        } else if (elem.mozRequestFullScreen) {
	            elem.mozRequestFullScreen();
	        } else if (elem.requestFullScreen) {
	            elem.requestFullscreen();
	        } else {
	            //浏览器不支持全屏API或已被禁用  
	        }
	    }  

	      // 手机短信
	       $('.sendCode').on('click', function() {
	        var m = 60;
	        // 设置倒计时
	        timer =setInterval(function () {
	            m --;
	            $('.sendCode').attr('disabled',true).html('已发送（'+m+'）');
	            if (m <= 0) {
	                $('.sendCode').attr('disabled',false).html('再次发送');
	                clearInterval(timer);
	            }
	        },1000);
	        var user= $('.user').val();
	        var data = 'user='+user;
	          $.ajax({
	                type : 'get',
	                url : 'Login/sendCode',
	                data : data,
	                dataType : 'json',
	                success : function (data) {
	                    if (data) {
	                       ErroAlert(data);
	                    }else {
	                      clearInterval(timer);
	                      ErroAlert('发送失败',function () {
	                          $('.sendCode').attr('disabled',false).html('请重新发送');
	                      });
	                    }
	                },
	                error : function () {
	                    console.log(data);
	                    alert('访问出错');
	                }
	            });
	        });

	          $('.sendE').on('click', function() {
	        var m = 60;
	        // 设置倒计时
	        timer =setInterval(function () {
	            m --;
	            $('.sendE').attr('disabled',true).html('已发送（'+m+'）');
	            if (m <= 0) {
	                $('.sendE').attr('disabled',false).html('再次发送');
	                clearInterval(timer);
	            }
	        },1000);
	        var user= $('.user').val();
	        var data = 'user='+user;
	          $.ajax({
	                type : 'get',
	                url : '/index/login/email',
	                data : data,
	                dataType : 'json',
	                success : function (data) {
	                    if (data) {
	                       ErroAlert(data);
	                    }else {
	                      clearInterval(timer);
	                      ErroAlert('发送失败',function () {
	                          $('.sendE').attr('disabled',false).html('请重新发送');
	                      });
	                    }
	                },
	                error : function () {
	                    console.log(data);
	                    alert('访问出错');
	                }
	            });
	        });

		$('#zc').click(function(){
			$(location).attr('href', '/index/login/zc')
		})
	    });




		
		
    </script>

</body>
</html>
